home *** CD-ROM | disk | FTP | other *** search
- Path: library.erc.clarkson.edu!rpi!not-for-mail
- From: Dave Nulton <dnult@axiom.net>
- Newsgroups: comp.lang.c++.moderated,comp.lang.c++
- Subject: Re: Meaning of the specifier volatile?
- Date: 2 Jan 1996 11:39:47 -0000
- Organization: Axiom Communications
- Sender: cppmods@netlab.cs.rpi.edu
- Approved: kanze@gabi-soft.fr
- Message-ID: <4cb5i3$5mr@netlab.cs.rpi.edu>
- References: <4c9740$27n@netlab.cs.rpi.edu>
- NNTP-Posting-Host: netlab.cs.rpi.edu
-
- X-Original-Date: 2 Jan 1996 07:22:26 GMT
-
- I'm no expert but here is what I know. The specifier volatile is
- a directive to the compiler that the variable declared volatile
- can change at any moment. The compiler will then make no
- assumptions about the contents of this variable, and will always
- re-check its value when used. An example of something that might
- use volatile variables is: a hardware interface to your PC which
- reads analog data and converts it to digital. Your program may
- read the data from the PC bus. However this data is always
- changing and your program should make know assumptions that the
- data is the same - it should always recheck the value.
-
- I'm sure there are other less complicated applications which may
- benefit from volatile variables. I'm sure one of the many other
- experts on the net can elaborate.
-
- -dnult@axiom.net
-
-
- [ comp.lang.c++.moderated is a moderated newsgroup. Submit articles ]
- [ to <c++-submit@netlab.cs.rpi.edu>. The moderation policy can be ]
- [ retrieved from <http://netlab.cs.rpi.edu/~cppmods/guide.html>. ]
- [ Moderators can be reached at: c++-request@netlab.cs.rpi.edu. ]
-